<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
        >
<h:head>
    <title>Facelet Title</title>
</h:head>

<body>
<ui:composition>
    <p:outputPanel autoUpdate="true">
        <script>
            function testIfOk() {
                //alert('ok');
                if ('' == '#{changeFileDir.errStr}') {
                    changeFileDir.hide();

                }
            }
        </script>
    </p:outputPanel>
    <p:dialog id="changeFileDir" width="450" widgetVar="changeFileDir" header="移动文件"
              style="text-align:left;position:absolute;">
        <p:treeTable value="#{changeFileDir.root}" var="file" selection="#{changeFileDir.selectedNode}"
                     selectionMode="single">
            <p:column style="width:150px">
                <f:facet name="header">
                    <h:outputText value="请选择目标文件夹"/>
                </f:facet>
                <h:graphicImage value="/resources/images/folder.gif" style="vertical-align: middle;"></h:graphicImage>
                <h:outputText value="#{file.fileName}"/>
            </p:column>
        </p:treeTable>
        <p:separator style="margin:5px 0px 10px 0px"/>
        <h:panelGrid columns="2">
            <p:commandButton action="#{changeFileDir.doChange}" value="完成" update="dc :myForm:message1"
                             oncomplete="testIfOk();">
            </p:commandButton>
        </h:panelGrid>
        <p:growl id="message1"/>
    </p:dialog>
</ui:composition>
</body>
</html>

